package com.market.manager;

import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.market.domain.Picture;
import com.market.domain.Product;
import com.market.domain.Supplier;

public interface SupplierManager extends GenericManager<Supplier, Long> {
	
	/**
	 * This method load all products supplied by this supplier
	 * @param supplier
	 * @return
	 */
	@Transactional(propagation = Propagation.REQUIRED, readOnly=true)
	public List<Product> fetchProducts(Supplier supplier);
	
	/**
	 * This method load all picture related to this supplier;
	 * @param supplier
	 * @return
	 */
	@Transactional(propagation = Propagation.REQUIRED, readOnly=true)
	public List<Picture> fetchPictures(Supplier supplier);
}
